{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport MonthHeader from \"./MonthHeader\";\nimport MonthBody, { MONTH_COL_COUNT } from \"./MonthBody\";\nimport { createKeyDownHandler } from \"../../utils/uiUtil\";\nfunction MonthPanel(props) {\n  var prefixCls = props.prefixCls,\n    operationRef = props.operationRef,\n    onViewDateChange = props.onViewDateChange,\n    generateConfig = props.generateConfig,\n    value = props.value,\n    viewDate = props.viewDate,\n    onPanelChange = props.onPanelChange,\n    _onSelect = props.onSelect;\n  var panelPrefixCls = \"\".concat(prefixCls, \"-month-panel\"); // ======================= Keyboard =======================\n\n  operationRef.current = {\n    onKeyDown: function onKeyDown(event) {\n      return createKeyDownHandler(event, {\n        onLeftRight: function onLeftRight(diff) {\n          _onSelect(generateConfig.addMonth(value || viewDate, diff), 'key');\n        },\n        onCtrlLeftRight: function onCtrlLeftRight(diff) {\n          _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n        },\n        onUpDown: function onUpDown(diff) {\n          _onSelect(generateConfig.addMonth(value || viewDate, diff * MONTH_COL_COUNT), 'key');\n        },\n        onEnter: function onEnter() {\n          onPanelChange('date', value || viewDate);\n        }\n      });\n    }\n  }; // ==================== View Operation ====================\n\n  var onYearChange = function onYearChange(diff) {\n    var newDate = generateConfig.addYear(viewDate, diff);\n    onViewDateChange(newDate);\n    onPanelChange(null, newDate);\n  };\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: panelPrefixCls\n  }, /*#__PURE__*/React.createElement(MonthHeader, _extends({}, props, {\n    prefixCls: prefixCls,\n    onPrevYear: function onPrevYear() {\n      onYearChange(-1);\n    },\n    onNextYear: function onNextYear() {\n      onYearChange(1);\n    },\n    onYearClick: function onYearClick() {\n      onPanelChange('year', viewDate);\n    }\n  })), /*#__PURE__*/React.createElement(MonthBody, _extends({}, props, {\n    prefixCls: prefixCls,\n    onSelect: function onSelect(date) {\n      _onSelect(date, 'mouse');\n      onPanelChange('date', date);\n    }\n  })));\n}\nexport default MonthPanel;","map":{"version":3,"names":["_extends","React","MonthHeader","MonthBody","MONTH_COL_COUNT","createKeyDownHandler","MonthPanel","props","prefixCls","operationRef","onViewDateChange","generateConfig","value","viewDate","onPanelChange","_onSelect","onSelect","panelPrefixCls","concat","current","onKeyDown","event","onLeftRight","diff","addMonth","onCtrlLeftRight","addYear","onUpDown","onEnter","onYearChange","newDate","createElement","className","onPrevYear","onNextYear","onYearClick","date"],"sources":["/data/messenger.client/node_modules/rc-picker/es/panels/MonthPanel/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport MonthHeader from \"./MonthHeader\";\nimport MonthBody, { MONTH_COL_COUNT } from \"./MonthBody\";\nimport { createKeyDownHandler } from \"../../utils/uiUtil\";\n\nfunction MonthPanel(props) {\n  var prefixCls = props.prefixCls,\n      operationRef = props.operationRef,\n      onViewDateChange = props.onViewDateChange,\n      generateConfig = props.generateConfig,\n      value = props.value,\n      viewDate = props.viewDate,\n      onPanelChange = props.onPanelChange,\n      _onSelect = props.onSelect;\n  var panelPrefixCls = \"\".concat(prefixCls, \"-month-panel\"); // ======================= Keyboard =======================\n\n  operationRef.current = {\n    onKeyDown: function onKeyDown(event) {\n      return createKeyDownHandler(event, {\n        onLeftRight: function onLeftRight(diff) {\n          _onSelect(generateConfig.addMonth(value || viewDate, diff), 'key');\n        },\n        onCtrlLeftRight: function onCtrlLeftRight(diff) {\n          _onSelect(generateConfig.addYear(value || viewDate, diff), 'key');\n        },\n        onUpDown: function onUpDown(diff) {\n          _onSelect(generateConfig.addMonth(value || viewDate, diff * MONTH_COL_COUNT), 'key');\n        },\n        onEnter: function onEnter() {\n          onPanelChange('date', value || viewDate);\n        }\n      });\n    }\n  }; // ==================== View Operation ====================\n\n  var onYearChange = function onYearChange(diff) {\n    var newDate = generateConfig.addYear(viewDate, diff);\n    onViewDateChange(newDate);\n    onPanelChange(null, newDate);\n  };\n\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: panelPrefixCls\n  }, /*#__PURE__*/React.createElement(MonthHeader, _extends({}, props, {\n    prefixCls: prefixCls,\n    onPrevYear: function onPrevYear() {\n      onYearChange(-1);\n    },\n    onNextYear: function onNextYear() {\n      onYearChange(1);\n    },\n    onYearClick: function onYearClick() {\n      onPanelChange('year', viewDate);\n    }\n  })), /*#__PURE__*/React.createElement(MonthBody, _extends({}, props, {\n    prefixCls: prefixCls,\n    onSelect: function onSelect(date) {\n      _onSelect(date, 'mouse');\n\n      onPanelChange('date', date);\n    }\n  })));\n}\n\nexport default MonthPanel;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,SAAS,IAAIC,eAAe,QAAQ,aAAa;AACxD,SAASC,oBAAoB,QAAQ,oBAAoB;AAEzD,SAASC,UAAU,CAACC,KAAK,EAAE;EACzB,IAAIC,SAAS,GAAGD,KAAK,CAACC,SAAS;IAC3BC,YAAY,GAAGF,KAAK,CAACE,YAAY;IACjCC,gBAAgB,GAAGH,KAAK,CAACG,gBAAgB;IACzCC,cAAc,GAAGJ,KAAK,CAACI,cAAc;IACrCC,KAAK,GAAGL,KAAK,CAACK,KAAK;IACnBC,QAAQ,GAAGN,KAAK,CAACM,QAAQ;IACzBC,aAAa,GAAGP,KAAK,CAACO,aAAa;IACnCC,SAAS,GAAGR,KAAK,CAACS,QAAQ;EAC9B,IAAIC,cAAc,GAAG,EAAE,CAACC,MAAM,CAACV,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;;EAE3DC,YAAY,CAACU,OAAO,GAAG;IACrBC,SAAS,EAAE,SAASA,SAAS,CAACC,KAAK,EAAE;MACnC,OAAOhB,oBAAoB,CAACgB,KAAK,EAAE;QACjCC,WAAW,EAAE,SAASA,WAAW,CAACC,IAAI,EAAE;UACtCR,SAAS,CAACJ,cAAc,CAACa,QAAQ,CAACZ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